#app {
  // 添加3D透视效果容器
  perspective: 1000px;
  
  .main-container {
    position: relative;
    min-height: 100%;
    margin-left: $sideBarWidth;
    transition: margin-left 0.2s;
  }

  .sidebar-container {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1001;
    width: $sideBarWidth !important;
    height: 100vh;
    overflow: hidden;
    background-color: $menuBg;
    transition: width 0.2s;
    // 添加立体感效果
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.3);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    // 添加3D变换
    transform-style: preserve-3d;

    // reset element-ui css
    .horizontal-collapse-transition {
      transition: 0s width ease-in-out, 0s padding-left ease-in-out,
        0s padding-right ease-in-out;
    }

    .scrollbar-wrapper {
      overflow-x: hidden !important;
    }

    .el-scrollbar__bar.is-vertical {
      right: 0;
    }

    .el-scrollbar {
      height: 100%;
    }

    &.has-logo {
      .el-scrollbar {
        height: calc(100% - 50px);
      }
    }

    .is-horizontal {
      display: none;
    }

    .sub-el-icon {
      margin-right: 12px;
      margin-left: -2px;
    }

    .el-menu {
      width: 100% !important;
      height: 100%;
      border: none;
    }

    // menu hover
    .el-sub-menu__title {
      &:hover {
        background-color: $menuHover !important;

        box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.2);
        transform: translateZ(5px);
        transition: all 0.3s ease;
      }
    }

    .is-active > .el-sub-menu__title {
      color: $subMenuActiveText !important;
      // 添加激活状态立体效果
      box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
      background: linear-gradient(90deg, $menuHover 0%, darken($menuHover, 5%) 100%) !important;
    }

    & .nest-menu .el-sub-menu > .el-sub-menu__title,
    & .el-sub-menu .el-menu-item {
      min-width: $sideBarWidth !important;
      background-color: $subMenuBg !important;
      // 添加子菜单项立体效果
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
      border-top: 1px solid rgba(0, 0, 0, 0.1);
      transition: all 0.3s ease;

      &:hover {
        background-color: $subMenuHover !important;
        // 添加悬停立体效果
        box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.2);
        transform: translateZ(5px);
      }
    }
  }

  .hideSidebar {
    .sidebar-container {
      width: $collapseSideBarWidth !important;
      // 折叠状态下的立体效果
      box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
    }

    .main-container {
      margin-left: $collapseSideBarWidth;
    }

    .el-sub-menu {
      overflow: hidden;

      & > .el-sub-menu__title {
        // padding: 0 !important;

        .sub-el-icon {
          margin-left: 19px;
          filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.3));
        }

        .el-sub-menu__icon-arrow {
          display: none;
          transition: none;
        }
      }
    }

    .el-menu--collapse {
      .el-sub-menu {
        & > .el-sub-menu__title {
          & > div {
            & > span {
              display: inline-block;
              width: 0;
              height: 0;
              overflow: hidden;
              visibility: hidden;
            }
          }
        }
      }
    }
  }

  .el-menu--collapse .el-menu .el-sub-menu {
    min-width: $sideBarWidth !important;
  }

  // mobile responsive
  .mobile {
    .main-container {
      margin-left: 0;
    }

    .sidebar-container {
      width: $sideBarWidth !important;
      transition: transform 0.28s;
    }

    &.hideSidebar {
      .sidebar-container {
        pointer-events: none;
        transition-duration: 0.3s;
        transform: translate3d(-$sideBarWidth, 0, 0);
      }
    }
  }

  .withoutAnimation {
    .main-container,
    .sidebar-container {
      transition: none;
    }
  }
}

// when menu collapsed
.el-menu--vertical {
  & > .el-menu {

    .sub-el-icon {
      margin-right: 12px;
      margin-left: -2px;
    }
  }

  .nest-menu .el-sub-menu > .el-sub-menu__title,
  .el-menu-item {
    &:hover {
      // you can use $subMenuHover
    }
  }

  // the scroll bar appears when the subMenu is too long
  > .el-menu--popup {
    max-height: 100vh;
    overflow-y: auto;

    &::-webkit-scrollbar-track-piece {
      background: #d3dce6;
    }

    &::-webkit-scrollbar {
      width: 6px;
    }

    &::-webkit-scrollbar-thumb {
      background: #99a9bf;
      border-radius: 20px;
    }
  }
}
